package com.yaodian100.ec.shelf.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.shelf.entity.Shelf;
import com.yaodian100.ec.shelf.entity.ViewFlagProduct;
import com.yaodian100.ec.shelf.entity.ViewShelf;
import com.yaodian100.ec.shelf.entity.ViewShelfProduct;

public interface ShelfService extends DomainService<Shelf> {

	public List<ViewShelf> getPublishShelfs(Long categoryId, String[] productIds) throws CoreException;

	public Shelf getActiveShelfByProductId(String productId) throws CoreException;

	public List<ViewFlagProduct> getViewFlagProduct(CommonCriteria criteria, String[] sortBy, int startNode, int pageSize)
			throws CoreException;

	public List<ViewFlagProduct> getViewFlagProductForIdxTab3(String date, String orderBy, int startNode, int pageSize)
			throws CoreException;

	public Number getViewFlagProductSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依條件取得上架中的商品資料
	 * 
	 * @param categoryId
	 * @param sortBy
	 * @param startNode
	 * @param pageSize
	 * @return
	 * @throws CoreException
	 */
	public List<ViewShelfProduct> getViewShelfProduct(CommonCriteria criteria, String[] sortBy, int startNode,
			int pageSize) throws CoreException;

	/**
	 * 依條件取得上架中的商品筆數
	 * 
	 * @param categoryId
	 * @return
	 * @throws CoreException
	 */
	public Number getViewShelfProductSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 新增/修改上架檔
	 * 
	 * @param shelf
	 * @return
	 * @throws CoreException
	 */
	public Shelf saveOrUpdateShelf(Shelf shelf) throws CoreException;

	public List<Map<String, Object>> getShelfHistory(String productId) throws Exception;

	/**
	 * @param criteria
	 * @param sortBy
	 * @param startNode
	 * @param pageSize
	 * @return
	 * @throws CoreException
	 */
	public List<Shelf> getShelfApproveList(Map<String, Object> attrs, String[] sortBy, int startNode, int pageSize)
			throws CoreException;

	public Number getShelfApproveListSize(Map<String, Object> attrs) throws CoreException;

	public Shelf getShelfByProductId(String productId, Date startDate, Date endDate) throws CoreException;

	public Shelf addShelf(Shelf shelf) throws CoreException;

}
